Error: Failed to load plugin 'stylelint' declared in '.eslintrc.json': Cannot find module 'eslint 您所在的位置:网站首页 1 error cannot find lqsshd Error: Failed to load plugin 'stylelint' declared in '.eslintrc.json': Cannot find module 'eslint

Error: Failed to load plugin 'stylelint' declared in '.eslintrc.json': Cannot find module 'eslint

2023-04-21 05:28| 来源: 网络整理| 查看: 265

Node version: v18.16.0 npm version: v9.6.4 Local ESLint version: v8.38.0 (Currently used) Global ESLint version: Not found Operating System: linux 5.15.90.1-microsoft-standard-WSL2

Hello, I am trying to get eslint & stylelint configured to use with my css files in vscode. So far I've had mixed results. Sometimes it works, Sometimes it doesn't work. Sometimes it finds the eslintrc, then on restart, it becomes unresponsive.

Setting these linters up is surprisingly complicated. I'm not sure if this is a bug, or if it's my configuration. Please bear with my amateur configs as I haven't learned node. I have been doing everything on docs material, google searches, and trial & error.

SInce my configs won't change from project to project I decided to install everything in a way that I have to set everything up once. I originally made an attempt with a global setup, but that did not appear to work.

I decided to go about it with npm workspaces instead. All my learning projects are located inside ~/repos/packages. I've had instances where everything appeared to be functioning smoothly.

.eslintrc.json located in ~/repos .

{ "env": { "browser": true, "es2021": true, "node": true }, "plugins": [ "css", "stylelint", "import", "jsx-a11y", "react", "react-hooks", "unicorn", "prettier" ], "extends": [ "airbnb-base", "plugin:import/recommended", "plugin:css/recommended", "plugin:import/recommended", "plugin:unicorn/recommended", "eslint:recommended", "plugin:stylelint/standard", "/home/wavey1/repos/.stylelintrc.json", "/home/wavey1/repos/.eslintrc.json" ], "overrides": [], "parserOptions": { "ecmaVersion": "latest" }, "rules": {} }

package.json

{ "name": "reposandprojects", "version": "1.0.0", "private": true, "workspaces": [ "packages/*" ], "dependencies": { "lodash": "^4.17.21" }, "devDependencies": { "eslint-plugin-prettier": "^4.2.1", "@primer/css": "^21.0.0", "@primer/stylelint-config": "^12.7.0", "eslint": "^8.38.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^8.8.0", "eslint-config-standard": "^17.0.0", "eslint-config-stylelint": "^18.0.0", "eslint-plugin-css": "^0.7.0", "eslint-plugin-import": "^2.27.2", "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-unicorn": "^46.0.0", "postcss-html": "^1.5.0", "prettier": "^2.8.7", "stylelint": "^15.5.0", "stylelint-config-html": "^1.1.0", "stylelint-config-property-sort-order-smacss": "^9.1.0", "stylelint-config-recess-order": "^4.0.0", "stylelint-config-standard": "^32.0.0", "stylelint-order": "^6.0.3", "stylelint-stylistic": "^0.4.0" }, "scripts": { "format": "eslint --write \"./packages/**/*.{js,jsx,json,md}\"", "lint:css": "stylelint \"./packages/**/*.css\"", "lint:html": "stylelint \"./packages/**/*.html\"", "lint:js": "eslint \"./packages/**/*.{js,jsx}\"", "fix-code": "eslint --write './packages/**/*.{js,jsx}' && stylelint --fix './packages/**/*.css'" }, "prettier":"./home/wavey1/repos/.prettierrc.json", "eslint":"./home/wavey1/repos/.eslintrc.json" }

Please advise me on any additional info/configs/json you require.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有